128C - Games with Rectangle - CodeForces Solution


combinatorics dp *2000

Please click on ads to support us..

C++ Code:

/**
*  ┏┓   ┏┓+ +
* ┏┛┻━━━┛┻┓ + +
* ┃       ┃
* ┃   ━   ┃ ++ + + +
*  ████━████+
*  ◥██◤ ◥██◤ +
* ┃   ┻   ┃
* ┃       ┃ + +
* ┗━┓   ┏━┛
*   ┃   ┃ + + + +Code is far away from  
*   ┃   ┃ + bug with the animal protecting
*   ┃    ┗━━━┓ 神兽保佑,代码无bug 
*   ┃  	    ┣┓
*    ┃        ┏┛
*     ┗┓┓┏━┳┓┏┛ + + + +
*    ┃┫┫ ┃┫┫
*    ┗┻┛ ┗┻┛+ + + +
*/

#include<cstdio>
#include <iostream>
#include <algorithm>
#include <string.h>
#include <string>
#include <math.h>
#include<vector>
#include<queue>
#include<map>
#define sc_int(x) scanf("%d", &x)
#define sc_ll(x) scanf("%lld", &x)
#define pr_ll(x) printf("%lld", x)
#define pr_ll_n(x) printf("%lld\n", x)
#define pr_int_n(x) printf("%d\n", x)
#define ll long long 
using namespace std;

const int N=1000000+100,mod=1e9+7;
int n ,m,h;
ll s[2000][2100];


void initt()
{

    for(int i =1;i<=1000;i++)
    {
        s[i][i]=1;
        s[i][0]=1;
        for(int j =1;j<i;j++){
            s[i][j]=(s[i-1][j]%mod+s[i-1][j-1]%mod)%mod;
        }
    }

    
}

ll ksm(ll a,ll b)
{
    ll ans=0;
    while(b){
        if(b&1) ans=(a+ans)%mod;
        b>>=1;
        a=(a*2)%mod;
    }
    return ans%mod;
}




int main()
{
	int t;

    initt();    
    cin>>n>>m>>t;
    t*=2;
    n--,m--;
    cout<<s[n][t]*s[m][t]%mod<<endl;
	//slove();  


	return 0;
}

 					   					  		   		 		 				


Comments

Submit
0 Comments
More Questions

702A - Maximum Increase
1656D - K-good
1426A - Floor Number
876A - Trip For Meal
1326B - Maximums
1635C - Differential Sorting
961A - Tetris
1635B - Avoid Local Maximums
20A - BerOS file system
1637A - Sorting Parts
509A - Maximum in Table
1647C - Madoka and Childish Pranks
689B - Mike and Shortcuts
379B - New Year Present
1498A - GCD Sum
1277C - As Simple as One and Two
1301A - Three Strings
460A - Vasya and Socks
1624C - Division by Two and Permutation
1288A - Deadline
1617A - Forbidden Subsequence
914A - Perfect Squares
873D - Merge Sort
1251A - Broken Keyboard
463B - Caisa and Pylons
584A - Olesya and Rodion
799A - Carrot Cakes
1569B - Chess Tournament
1047B - Cover Points
1381B - Unmerge